const mongoose = require('mongoose')
const schema = new mongoose.Schema({
    username: { type: String ,unique:true},
    password: {
        type: String,
        select: false,
        set(val){
            return require("bcryptjs").hashSync(val,10);
        }
    },
    power:{type:String},
    name:{type:String},//admin 最高管理者  //user用户   //no 禁用
    // img:{type: String}
})

module.exports = mongoose.model('User',schema)